package router

import (
	"getaway/basic/config"
	"getaway/handler/api"
	"getaway/middleware"
	"github.com/gin-gonic/gin"
)

func Summerize(v1 *gin.RouterGroup) {
	summerize := v1.Group("/summerize")
	{
		summerize.Use(middleware.JWTAuth(config.KEY_JWT))
		summerize.GET("/orderStatisticsReq", api.OrderStatisticsReq)                       // 按日统计订单数据
		summerize.GET("/orderStatisticsRangeReq", api.OrderStatisticsRangeReq)             // 周日期统计订单数据
		summerize.GET("/orderStatisticsMonthReq", api.OrderStatisticsMonthReq)             // 按月统计订单数据
		summerize.GET("/orderStatisticsYearReq", api.OrderStatisticsYearReq)               // 按年统计订单数据
		summerize.GET("/dateAverageOrderAmount", api.DateAverageOrderAmount)               // 获取某天订单平均金额
		summerize.GET("/dateBetweenAverageOrderAmount", api.DateBetweenAverageOrderAmount) // 按范围日期统计订单平均价
		summerize.GET("/weekOrderAvgPriceReq", api.WeekOrderAvgPriceReq)                   // 按周统计订单平均价
		summerize.GET("/monthOrderAvgPriceReq", api.MonthOrderAvgPriceReq)                 // 按月统计订单平均价
		summerize.GET("/yearOrderAvgPriceReq", api.YearOrderAvgPriceReq)                   // 按年统计订单平均价
		summerize.GET("/purchaseConversion", api.PurchaseConversionReq)                    // 购买转化分析统计
		summerize.GET("/orderGrowthRate", api.OrderGrowthRateReq)                          // 订单增长率计算
		summerize.GET("/getRepurchaseByInterval", api.GetRepurchaseByInterval)             // 按时间间隔统计复购人数
	}
}
